#!python
# -*- coding:utf-8 -*-

import copy
import err_info_config

# 返回状态错误码
ERROR_CODE_INFO = err_info_config.ERROR_CODE_INFO

# passkey
PASSWORD_KEY = "THISISPASSWORDKEY!@#$~"


# 本机host
HOST = "127.0.0.1:8000"



# 允许创建品牌的个数
BRAND_NUMS = 5

# 允许创建产品个数
PRODUCT_NUMS = 10

# 允许创建原料个数
MATERIAL_NUMS = 10

# rc4秘钥
RC4_KEY = "0123456789~!@#$%"

# 溯码单价
SUMA_PRICE = 10             # 单位分


def getErrInfo(errName="Success", isClone=True):
    """
    :param errName: 错误名称
    :param isClone: 是否clone
    :return: 错误信息
    :type errName: str
    :type isClone: bool
    :rtype : dict
    """
    err = err_info_config.ERROR_CODE_INFO.get(errName)
    if not err:
        err = {"result": -1, "reason": u"未知错误！"}
    else:
        if isClone:
            err = copy.deepcopy(err)
    return err